WOLF core
WOLF: A Modular Estimation Framework for Robotics
XXXXXXXXXXXXXXXXXXXXXXXXvoid(0)" frameborder="0" name="MSearchResults" id="MSearchResults">
wolf::FactorBase Class Referenceabstract

Base class of factors: a constraint between state blocks of one or more nodes, given a measurement and its noise. More...

#include <core/factor/factor_base.h>

Inheritance diagram for wolf::FactorBase:
[legend]

Public Member Functions

 FactorBase (const std::string &_type, const FactorTopology &_top, const JacobianMethod &_jac_method, const Eigen::VectorXd &_measurement, const Eigen::MatrixXd &_measurement_sqrt_information_upper, const NodeStateBlocksPtrList &_node_state_block_list, const ProcessorBasePtr &_processor_ptr, const std::vector< StateBlockPtr > &_state_ptrs, bool _apply_loss_function, FactorStatus _status=FAC_ACTIVE)
 Constructor from the measurement, the upper triangular square root of its information matrix (Cholesky), the constrained nodes and their state blocks. More...
 
 ~FactorBase () override=default
 
virtual void remove (bool viral_remove_parent_without_children=false)
 Removes the factor (notifying the problem) and unregisters it from the factored nodes. More...
 
bool hasChildren () const override
 Returns whether the node has children in the Wolf tree. More...
 
unsigned int id () const
 Returns the factor id. More...
 
virtual FactorTopology getTopology () const final
 Returns the topology of the factor. More...
 
virtual void getTopology (FactorTopology _top) final
 Sets the topology of the factor (note: this setter is named getTopology) More...
 
std::string getTopologyString () const
 Returns the topology of the factor as a string. More...
 
virtual bool evaluate (const std::vector< const double * > &_states_ptr, Eigen::VectorXd &_residual, std::vector< Eigen::MatrixXd > &_jacobians) const =0
 Evaluates the residual (weighted by the measurement noise) and, optionally, the Jacobians at the state values in _states_ptr. More...
 
virtual Eigen::VectorXd residual () const
 Evaluates the residual (weighted by the measurement noise) at the current state values. More...
 
virtual Eigen::VectorXd expectation (const std::vector< const double * > &_states_ptr) const =0
 Evaluates the expected measurement at the state values in _states_ptr. More...
 
Eigen::VectorXd expectation () const
 Evaluates the expected measurement at the current state values. More...
 
virtual double cost () const
 Evaluates the cost of the factor at the current state values: squared norm of the residual (without loss function) More...
 
virtual JacobianMethod getJacobianMethod () const final
 Returns the jacobians computation method. More...
 
virtual std::vector< StateBlockConstPtr > getStateBlockPtrVector () const
 Returns a vector of pointers to the states in which this factor depends. More...
 
virtual std::vector< StateBlockPtr > getStateBlockPtrVector ()
 Returns a vector of pointers to the states in which this factor depends. More...
 
virtual std::vector< unsigned int > getStateSizes () const
 Returns a vector of the states sizes. More...
 
virtual const Eigen::VectorXd & getMeasurement () const
 Returns a reference to the measurement. More...
 
virtual const Eigen::MatrixXd & getMeasurementSquareRootInformationUpper () const
 Returns a reference to the measurement square root information. More...
 
FeatureBaseConstPtr getFeature () const
 Returns a pointer to the feature constrained from. More...
 
FeatureBasePtr getFeature ()
 Returns a pointer to the feature constrained from. More...
 
CaptureBaseConstPtr getCapture () const
 Returns a pointer to its capture. More...
 
CaptureBasePtr getCapture ()
 Returns a pointer to its capture. More...
 
FrameBaseConstPtr getFrame () const
 Returns a pointer to its frame. More...
 
FrameBasePtr getFrame ()
 Returns a pointer to its frame. More...
 
ProcessorBaseConstPtr getProcessor () const
 Returns the processor that created the factor (nullptr if none) More...
 
ProcessorBasePtr getProcessor ()
 Returns the processor that created the factor (nullptr if none) More...
 
virtual unsigned int getSize () const =0
 Returns the factor residual size. More...
 
FactorStatus getStatus () const
 Returns the status (active or inactive) More...
 
void setStatus (FactorStatus _status)
 Sets the status, notifying the problem to add (active) or remove (inactive) the factor from the solver. More...
 
bool getApplyLossFunction () const
 Returns whether a loss function is applied to this factor. More...
 
NodeStateBlocksWPtrList getNodesFactored ()
 Returns the nodes whose state blocks are constrained by the factor. More...
 
FrameBaseWPtrList getFramesFactored ()
 Returns the frames whose state blocks are constrained by the factor. More...
 
CaptureBaseWPtrList getCapturesFactored ()
 Returns the captures whose state blocks are constrained by the factor. More...
 
LandmarkBaseWPtrList getLandmarksFactored ()
 Returns the landmarks whose state blocks are constrained by the factor. More...
 
SensorBaseWPtrList getSensorsFactored ()
 Returns the sensors whose state blocks are constrained by the factor. More...
 
NodeStateBlocksConstWPtrList getNodesFactored () const
 Returns the nodes whose state blocks are constrained by the factor. More...
 
FrameBaseConstWPtrList getFramesFactored () const
 Returns the frames whose state blocks are constrained by the factor. More...
 
CaptureBaseConstWPtrList getCapturesFactored () const
 Returns the captures whose state blocks are constrained by the factor. More...
 
LandmarkBaseConstWPtrList getLandmarksFactored () const
 Returns the landmarks whose state blocks are constrained by the factor. More...
 
SensorBaseConstWPtrList getSensorsFactored () const
 Returns the sensors whose state blocks are constrained by the factor. More...
 
bool hasNode (const NodeStateBlocksConstPtr &_nsb) const
 Returns whether the factor constrains state blocks of the node. More...
 
bool hasFrame (const FrameBaseConstPtr &_frm) const
 Returns whether the factor constrains state blocks of the frame. More...
 
bool hasCapture (const CaptureBaseConstPtr &_cap) const
 Returns whether the factor constrains state blocks of the capture. More...
 
bool hasLandmark (const LandmarkBaseConstPtr &_lmk) const
 Returns whether the factor constrains state blocks of the landmark. More...
 
bool hasSensor (const SensorBaseConstPtr &_sen) const
 Returns whether the factor constrains state blocks of the sensor. More...
 
void link (FeatureBasePtr ftr)
 Links the factor to a feature and registers it in the factored nodes. More...
 
virtual void printHeader (int _depth, bool _factored_by, bool _metric, bool _state_blocks, std::ostream &_stream, std::string _tabs="") const
 Prints the information of this node (not of its children) More...
 
void print (int _depth, bool _factored_by, bool _metric, bool _state_blocks, std::ostream &_stream=std::cout, std::string _tabs="") const
 Prints this node and, depending on the depth, its children. More...
 
virtual CheckLog localCheck (bool _verbose, std::ostream &_stream, std::string _tabs="") const
 Checks the consistency of this node (not of its children) More...
 
bool check (CheckLog &_log, bool _verbose, std::ostream &_stream, std::string _tabs="") const
 Checks the consistency of this node and its children, composing the log. More...
 
- Public Member Functions inherited from wolf::NodeBase
 NodeBase (const std::string &_category, const std::string &_type="Undefined", const std::string &_name="")
 Constructor. More...
 
virtual ~NodeBase ()=default
 Destructor. More...
 
unsigned int nodeId () const
 Returns the node id, unique over the whole Wolf tree. More...
 
std::string getCategory () const
 Returns the category of the node. More...
 
std::string getType () const
 Returns the type (subcategory) of the node. More...
 
std::string getName () const
 Returns the name of the node. More...
 
bool isRemoving () const
 Returns whether the node is being removed. More...
 
virtual bool hasChildren () const =0
 Returns whether the node has children in the Wolf tree. More...
 
void setType (const std::string &_type)
 Sets the type (subcategory) of the node. More...
 
void setName (const std::string &_name)
 Sets the name of the node. More...
 
ProblemConstPtr getProblem () const
 Returns the problem the node belongs to. More...
 
ProblemPtr getProblem ()
 Returns the problem the node belongs to. More...
 

Static Public Member Functions

template<typename classType , typename... T>
static std::shared_ptr< classType > emplace (FeatureBasePtr _oth_ptr, T &&... all)
 Creates a factor of class classType and links it to the feature. More...
 

Protected Member Functions

void setProblem (ProblemPtr) override final
 Sets the problem and, if the factor is active, notifies the problem of its addition. More...
 
virtual void setProblem (ProblemPtr _prob_ptr)
 Sets the problem the node belongs to. More...
 

Protected Attributes

unsigned int factor_id_
 Factor id, unique among factors. More...
 
FactorTopology topology_
 Topology of factor. More...
 
JacobianMethod jacobian_method_
 Jacobian method. More...
 
FactorStatus status_
 Status of factor. More...
 
bool apply_loss_function_
 Whether a loss function is applied to this factor. More...
 
Eigen::VectorXd measurement_
 Measurement vector. More...
 
Eigen::MatrixXd measurement_sqrt_information_upper_
 Upper square root of the information matrix. More...
 
std::vector< unsigned int > state_block_sizes_
 Vector containing sizes of the state blocks involved. More...
 
std::vector< StateBlockPtr > state_block_vector_
 Vector containing the state blocks involved. More...
 
- Protected Attributes inherited from wolf::NodeBase
ProblemWPtr problem_ptr_
 Problem the node belongs to. More...
 
unsigned int node_id_
 Node id. It is unique over the whole Wolf Tree. More...
 
std::string node_category_
 Text label identifying the category of node ("SENSOR", "FEATURE", etc) More...
 
std::string node_type_
 Type or subcategory of node (derived class name: "SensorOdom2d", etc) More...
 
std::string node_name_
 
bool is_removing_
 A flag for safely removing nodes from the Wolf tree. See remove(). More...
 

Detailed Description

Base class of factors: a constraint between state blocks of one or more nodes, given a measurement and its noise.

Constructor & Destructor Documentation

◆ FactorBase()

wolf::FactorBase::FactorBase ( const std::string &  _type,
const FactorTopology &  _top,
const JacobianMethod &  _jac_method,
const Eigen::VectorXd &  _measurement,
const Eigen::MatrixXd &  _measurement_sqrt_information_upper,
const NodeStateBlocksPtrList &  _node_state_block_list,
const ProcessorBasePtr &  _processor_ptr,
const std::vector< StateBlockPtr > &  _state_ptrs,
bool  _apply_loss_function,
FactorStatus  _status = FAC_ACTIVE 
)

Constructor from the measurement, the upper triangular square root of its information matrix (Cholesky), the constrained nodes and their state blocks.

◆ ~FactorBase()

wolf::FactorBase::~FactorBase ( )
overridedefault

Member Function Documentation

◆ check()

bool wolf::FactorBase::check ( CheckLog &  _log,
bool  _verbose,
std::ostream &  _stream,
std::string  _tabs = "" 
) const

Checks the consistency of this node and its children, composing the log.

◆ cost()

double wolf::FactorBase::cost ( ) const
inlinevirtual

Evaluates the cost of the factor at the current state values: squared norm of the residual (without loss function)

◆ emplace()

template<typename classType , typename... T>
std::shared_ptr< classType > wolf::FactorBase::emplace ( FeatureBasePtr  _oth_ptr,
T &&...  all 
)
static

Creates a factor of class classType and links it to the feature.

◆ evaluate()

virtual bool wolf::FactorBase::evaluate ( const std::vector< const double * > &  _states_ptr,
Eigen::VectorXd &  _residual,
std::vector< Eigen::MatrixXd > &  _jacobians 
) const
pure virtual

Evaluates the residual (weighted by the measurement noise) and, optionally, the Jacobians at the state values in _states_ptr.

Parameters
_states_ptrpointers to the values of each state block (same order as getStateBlockPtrVector())
_residualoutput residual (resized to getSize())
_jacobiansinput/output Jacobians, one per state block:
  • if empty, only the residual is computed and _jacobians is left empty,
  • if its size is the number of state blocks, all Jacobians are computed (each one resized to getSize() x the state block size).
Returns
false if the evaluation failed

Implemented in wolf::FactorAnalytic, wolf::FactorAutodiff< FacT, RES, BLOCK_SIZES >, wolf::FactorAutodiff< FactorDiffDrive, RESIDUAL_SIZE, POSITION_SIZE, ORIENTATION_SIZE, POSITION_SIZE, ORIENTATION_SIZE, INTRINSICS_SIZE >, wolf::FactorAutodiff< FactorDistance3d, 1, 3, 3 >, wolf::FactorAutodiff< FactorHomogeneous3dAbsolute, 3, 4 >, wolf::FactorAutodiff< FactorPose2d, 3, 2, 1 >, wolf::FactorAutodiff< FactorPose2dWithExtrinsics, 3, 2, 1, 2, 1 >, wolf::FactorAutodiff< FactorPose3d, 6, 3, 4 >, wolf::FactorAutodiff< FactorPose3dWithExtrinsics, 6, 3, 4, 3, 4 >, wolf::FactorAutodiff< FactorQuaternionAbsolute, 3, 4 >, wolf::FactorAutodiff< FactorQuaternionDifference, 3, 4, 4 >, wolf::FactorAutodiff< FactorRelativePose2dWithExtrinsics, 3, 2, 1, 2, 1, 2, 1 >, wolf::FactorAutodiff< FactorRelativePose3d, 6, 3, 4, 3, 4 >, wolf::FactorAutodiff< FactorRelativePose3dWithExtrinsics, 6, 3, 4, 3, 4, 3, 4 >, wolf::FactorAutodiff< FactorRelativePosition2dWithExtrinsics, 2, 2, 1, 2, 2, 1 >, wolf::FactorAutodiff< FactorRelativePosition3d, 3, 3, 4, 3 >, wolf::FactorAutodiff< FactorRelativePosition3dWithExtrinsics, 3, 3, 4, 3, 3, 4 >, and wolf::FactorAutodiff< FactorVelocityLocalDirection3d, 2, 3, 4 >.

◆ expectation() [1/2]

Eigen::VectorXd wolf::FactorBase::expectation ( ) const

Evaluates the expected measurement at the current state values.

◆ expectation() [2/2]

virtual Eigen::VectorXd wolf::FactorBase::expectation ( const std::vector< const double * > &  _states_ptr) const
pure virtual

Evaluates the expected measurement at the state values in _states_ptr.

Parameters
_states_ptrpointers to the values of each state block (same order as getStateBlockPtrVector())

Implemented in wolf::FactorAutodiff< FactorDiffDrive, RESIDUAL_SIZE, POSITION_SIZE, ORIENTATION_SIZE, POSITION_SIZE, ORIENTATION_SIZE, INTRINSICS_SIZE >, wolf::FactorAutodiff< FactorDistance3d, 1, 3, 3 >, wolf::FactorAutodiff< FactorHomogeneous3dAbsolute, 3, 4 >, wolf::FactorAutodiff< FactorPose2d, 3, 2, 1 >, wolf::FactorAutodiff< FactorPose2dWithExtrinsics, 3, 2, 1, 2, 1 >, wolf::FactorAutodiff< FactorPose3d, 6, 3, 4 >, wolf::FactorAutodiff< FactorPose3dWithExtrinsics, 6, 3, 4, 3, 4 >, wolf::FactorAutodiff< FactorQuaternionAbsolute, 3, 4 >, wolf::FactorAutodiff< FactorQuaternionDifference, 3, 4, 4 >, wolf::FactorAutodiff< FactorRelativePose2dWithExtrinsics, 3, 2, 1, 2, 1, 2, 1 >, wolf::FactorAutodiff< FactorRelativePose3d, 6, 3, 4, 3, 4 >, wolf::FactorAutodiff< FactorRelativePose3dWithExtrinsics, 6, 3, 4, 3, 4, 3, 4 >, wolf::FactorAutodiff< FactorRelativePosition2dWithExtrinsics, 2, 2, 1, 2, 2, 1 >, wolf::FactorAutodiff< FactorRelativePosition3d, 3, 3, 4, 3 >, wolf::FactorAutodiff< FactorRelativePosition3dWithExtrinsics, 3, 3, 4, 3, 3, 4 >, wolf::FactorAutodiff< FactorVelocityLocalDirection3d, 2, 3, 4 >, wolf::FactorAnalytic, wolf::FactorAutodiff< FacT, RES, BLOCK_SIZES >, wolf::FactorAutodiff< FactorDiffDrive, RESIDUAL_SIZE, POSITION_SIZE, ORIENTATION_SIZE, POSITION_SIZE, ORIENTATION_SIZE, INTRINSICS_SIZE >, wolf::FactorAutodiff< FactorDistance3d, 1, 3, 3 >, wolf::FactorAutodiff< FactorHomogeneous3dAbsolute, 3, 4 >, wolf::FactorAutodiff< FactorPose2d, 3, 2, 1 >, wolf::FactorAutodiff< FactorPose2dWithExtrinsics, 3, 2, 1, 2, 1 >, wolf::FactorAutodiff< FactorPose3d, 6, 3, 4 >, wolf::FactorAutodiff< FactorPose3dWithExtrinsics, 6, 3, 4, 3, 4 >, wolf::FactorAutodiff< FactorQuaternionAbsolute, 3, 4 >, wolf::FactorAutodiff< FactorQuaternionDifference, 3, 4, 4 >, wolf::FactorAutodiff< FactorRelativePose2dWithExtrinsics, 3, 2, 1, 2, 1, 2, 1 >, wolf::FactorAutodiff< FactorRelativePose3d, 6, 3, 4, 3, 4 >, wolf::FactorAutodiff< FactorRelativePose3dWithExtrinsics, 6, 3, 4, 3, 4, 3, 4 >, wolf::FactorAutodiff< FactorRelativePosition2dWithExtrinsics, 2, 2, 1, 2, 2, 1 >, wolf::FactorAutodiff< FactorRelativePosition3d, 3, 3, 4, 3 >, wolf::FactorAutodiff< FactorRelativePosition3dWithExtrinsics, 3, 3, 4, 3, 3, 4 >, wolf::FactorAutodiff< FactorVelocityLocalDirection3d, 2, 3, 4 >, wolf::FactorAnalytic, and wolf::FactorAutodiff< FacT, RES, BLOCK_SIZES >.

◆ getApplyLossFunction()

bool wolf::FactorBase::getApplyLossFunction ( ) const
inline

Returns whether a loss function is applied to this factor.

◆ getCapture() [1/2]

CaptureBasePtr wolf::FactorBase::getCapture ( )

Returns a pointer to its capture.

◆ getCapture() [2/2]

CaptureBaseConstPtr wolf::FactorBase::getCapture ( ) const

Returns a pointer to its capture.

◆ getCapturesFactored() [1/2]

CaptureBaseWPtrList wolf::FactorBase::getCapturesFactored ( )
inline

Returns the captures whose state blocks are constrained by the factor.

◆ getCapturesFactored() [2/2]

CaptureBaseConstWPtrList wolf::FactorBase::getCapturesFactored ( ) const
inline

Returns the captures whose state blocks are constrained by the factor.

◆ getFeature() [1/2]

FeatureBasePtr wolf::FactorBase::getFeature ( )
inline

Returns a pointer to the feature constrained from.

◆ getFeature() [2/2]

FeatureBaseConstPtr wolf::FactorBase::getFeature ( ) const
inline

Returns a pointer to the feature constrained from.

◆ getFrame() [1/2]

FrameBasePtr wolf::FactorBase::getFrame ( )

Returns a pointer to its frame.

◆ getFrame() [2/2]

FrameBaseConstPtr wolf::FactorBase::getFrame ( ) const

Returns a pointer to its frame.

◆ getFramesFactored() [1/2]

FrameBaseWPtrList wolf::FactorBase::getFramesFactored ( )
inline

Returns the frames whose state blocks are constrained by the factor.

◆ getFramesFactored() [2/2]

FrameBaseConstWPtrList wolf::FactorBase::getFramesFactored ( ) const
inline

Returns the frames whose state blocks are constrained by the factor.

◆ getJacobianMethod()

virtual JacobianMethod wolf::FactorBase::getJacobianMethod ( ) const
inlinefinalvirtual

Returns the jacobians computation method.

◆ getLandmarksFactored() [1/2]

LandmarkBaseWPtrList wolf::FactorBase::getLandmarksFactored ( )
inline

Returns the landmarks whose state blocks are constrained by the factor.

◆ getLandmarksFactored() [2/2]

LandmarkBaseConstWPtrList wolf::FactorBase::getLandmarksFactored ( ) const
inline

Returns the landmarks whose state blocks are constrained by the factor.

◆ getMeasurement()

const Eigen::VectorXd & wolf::FactorBase::getMeasurement ( ) const
inlinevirtual

Returns a reference to the measurement.

◆ getMeasurementSquareRootInformationUpper()

const Eigen::MatrixXd & wolf::FactorBase::getMeasurementSquareRootInformationUpper ( ) const
inlinevirtual

Returns a reference to the measurement square root information.

◆ getNodesFactored() [1/2]

NodeStateBlocksWPtrList wolf::FactorBase::getNodesFactored ( )
inline

Returns the nodes whose state blocks are constrained by the factor.

◆ getNodesFactored() [2/2]

NodeStateBlocksConstWPtrList wolf::FactorBase::getNodesFactored ( ) const
inline

Returns the nodes whose state blocks are constrained by the factor.

◆ getProcessor() [1/2]

ProcessorBasePtr wolf::FactorBase::getProcessor ( )
inline

Returns the processor that created the factor (nullptr if none)

◆ getProcessor() [2/2]

ProcessorBaseConstPtr wolf::FactorBase::getProcessor ( ) const
inline

Returns the processor that created the factor (nullptr if none)

◆ getSensorsFactored() [1/2]

SensorBaseWPtrList wolf::FactorBase::getSensorsFactored ( )
inline

Returns the sensors whose state blocks are constrained by the factor.

◆ getSensorsFactored() [2/2]

SensorBaseConstWPtrList wolf::FactorBase::getSensorsFactored ( ) const
inline

Returns the sensors whose state blocks are constrained by the factor.

◆ getSize()

◆ getStateBlockPtrVector() [1/2]

std::vector< StateBlockPtr > wolf::FactorBase::getStateBlockPtrVector ( )
inlinevirtual

Returns a vector of pointers to the states in which this factor depends.

◆ getStateBlockPtrVector() [2/2]

std::vector< StateBlockConstPtr > wolf::FactorBase::getStateBlockPtrVector ( ) const
inlinevirtual

Returns a vector of pointers to the states in which this factor depends.

◆ getStateSizes()

std::vector< unsigned int > wolf::FactorBase::getStateSizes ( ) const
inlinevirtual

Returns a vector of the states sizes.

◆ getStatus()

FactorStatus wolf::FactorBase::getStatus ( ) const
inline

Returns the status (active or inactive)

◆ getTopology() [1/2]

virtual FactorTopology wolf::FactorBase::getTopology ( ) const
inlinefinalvirtual

Returns the topology of the factor.

◆ getTopology() [2/2]

virtual void wolf::FactorBase::getTopology ( FactorTopology  _top)
inlinefinalvirtual

Sets the topology of the factor (note: this setter is named getTopology)

◆ getTopologyString()

std::string wolf::FactorBase::getTopologyString ( ) const
inline

Returns the topology of the factor as a string.

◆ hasCapture()

bool wolf::FactorBase::hasCapture ( const CaptureBaseConstPtr &  _cap) const

Returns whether the factor constrains state blocks of the capture.

◆ hasChildren()

bool wolf::FactorBase::hasChildren ( ) const
inlineoverridevirtual

Returns whether the node has children in the Wolf tree.

Implements wolf::NodeBase.

◆ hasFrame()

bool wolf::FactorBase::hasFrame ( const FrameBaseConstPtr &  _frm) const

Returns whether the factor constrains state blocks of the frame.

◆ hasLandmark()

bool wolf::FactorBase::hasLandmark ( const LandmarkBaseConstPtr &  _lmk) const

Returns whether the factor constrains state blocks of the landmark.

◆ hasNode()

bool wolf::FactorBase::hasNode ( const NodeStateBlocksConstPtr &  _nsb) const

Returns whether the factor constrains state blocks of the node.

◆ hasSensor()

bool wolf::FactorBase::hasSensor ( const SensorBaseConstPtr &  _sen) const

Returns whether the factor constrains state blocks of the sensor.

◆ id()

unsigned int wolf::FactorBase::id ( ) const
inline

Returns the factor id.

◆ link()

void wolf::FactorBase::link ( FeatureBasePtr  ftr)

Links the factor to a feature and registers it in the factored nodes.

◆ localCheck()

CheckLog wolf::FactorBase::localCheck ( bool  _verbose,
std::ostream &  _stream,
std::string  _tabs = "" 
) const
virtual

Checks the consistency of this node (not of its children)

◆ print()

void wolf::FactorBase::print ( int  _depth,
bool  _factored_by,
bool  _metric,
bool  _state_blocks,
std::ostream &  _stream = std::cout,
std::string  _tabs = "" 
) const

Prints this node and, depending on the depth, its children.

◆ printHeader()

void wolf::FactorBase::printHeader ( int  _depth,
bool  _factored_by,
bool  _metric,
bool  _state_blocks,
std::ostream &  _stream,
std::string  _tabs = "" 
) const
virtual

Prints the information of this node (not of its children)

◆ remove()

void wolf::FactorBase::remove ( bool  viral_remove_parent_without_children = false)
virtual

Removes the factor (notifying the problem) and unregisters it from the factored nodes.

Parameters
viral_remove_parent_without_childrenif true, removes the feature if it is left without children

◆ residual()

Eigen::VectorXd wolf::FactorBase::residual ( ) const
virtual

Evaluates the residual (weighted by the measurement noise) at the current state values.

◆ setProblem()

void wolf::FactorBase::setProblem ( ProblemPtr  _problem)
finaloverrideprotectedvirtual

Sets the problem and, if the factor is active, notifies the problem of its addition.

Reimplemented from wolf::NodeBase.

◆ setStatus()

void wolf::FactorBase::setStatus ( FactorStatus  _status)

Sets the status, notifying the problem to add (active) or remove (inactive) the factor from the solver.

Member Data Documentation

◆ apply_loss_function_

bool wolf::FactorBase::apply_loss_function_
protected

Whether a loss function is applied to this factor.

◆ factor_id_

unsigned int wolf::FactorBase::factor_id_
protected

Factor id, unique among factors.

◆ jacobian_method_

JacobianMethod wolf::FactorBase::jacobian_method_
protected

Jacobian method.

◆ measurement_

Eigen::VectorXd wolf::FactorBase::measurement_
protected

Measurement vector.

◆ measurement_sqrt_information_upper_

Eigen::MatrixXd wolf::FactorBase::measurement_sqrt_information_upper_
protected

Upper square root of the information matrix.

◆ state_block_sizes_

std::vector<unsigned int> wolf::FactorBase::state_block_sizes_
protected

Vector containing sizes of the state blocks involved.

◆ state_block_vector_

std::vector<StateBlockPtr> wolf::FactorBase::state_block_vector_
protected

Vector containing the state blocks involved.

◆ status_

FactorStatus wolf::FactorBase::status_
protected

Status of factor.

◆ topology_

FactorTopology wolf::FactorBase::topology_
protected

Topology of factor.


The documentation for this class was generated from the following files: